home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of MacTutor - S…e Code for Volumes 1 to 5
/
The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin
/
Source Code
/
#27 (Dec 87)
/
scheme example
/
code--to-run
Wrap
Text File
|
1987-09-18
|
731b
|
24 lines
(begin-tasking)
(define (unequal1 x . lists)
(cond ((null? lists) #f)
((equal? x (car lists))
(apply unequal1 (cons x (cdr lists))))
(else (car lists))))
(define (unequal2 x . objects)
(let* ((ans #f)
(task-count (length objects))
(tasks (map (lambda (y)
(start-task
(lambda ()
(if (not (equal? x y))
(begin (set! ans y)
(set! task-count 0)))
(set! task-count (- task-count 1)))))
objects)))
(while (> task-count 0)
(surrender-timeslice))
(for-each kill-task tasks)
ans))